<?php
namespace Home\Model;
//物品基础属性
class Money extends Container{
    protected $redis;
    protected $user;
    protected $type ;
    protected $index ;
    protected $username ;
    
    public function __construct($user){
        //数据集
        parent::__construct($user, 'money');
    }
    public function initData(){
        $this->add(1350, 'gold');
        $this->add(20, 'gem');
        $this->add(0, 'xp');
        $this->add(1, 'level');
    }
    //加
    public function add($amount, $name='gold'){
        return parent::add($name, $amount);
    }
    //减
    public function dec($amount, $name='gold', $pre = false){
        return parent::dec($name, $amount, $pre);
    }
} 